package com.wchat.dataobject;

import com.wchat.enums.OrderStatusEnum;
import com.wchat.enums.PayStatusEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.transaction.Transactional;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by yangtianrui on 17/8/11.
 */
@Entity
@DynamicUpdate
@Data
public class OrderMaster {

    @Id
    private String orderId;
    /**买家姓名*/
    private String buyerName;
    /**买家电话*/
    private String buyerPhone;
    /**买家地址*/
    private String buyerAddress;
    /**买家openid*/
    private String buyerOpenid;
    /**订单数量*/
    private BigDecimal orderAmount;
    /**默认新订单*/
    private Integer orderStatus = OrderStatusEnum.NEW.getCode();
    /** 订单状态 默认为0 未支付 */
    private Integer payStatus = PayStatusEnum.WAIT.getCode();
    /** 创建时间*/
    private Date createTime;
    /** 修改时间*/
    private Date updateTime;

    @Override
    public String toString() {
        return "OrderMaster{" +
                "buyerAddress='" + buyerAddress + '\'' +
                ", orderId='" + orderId + '\'' +
                ", buyerName='" + buyerName + '\'' +
                ", buyerPhone='" + buyerPhone + '\'' +
                ", buyerOpenid='" + buyerOpenid + '\'' +
                ", orderAmount=" + orderAmount +
                ", orderStatus=" + orderStatus +
                ", payStatus=" + payStatus +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
